<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for QueryPathExtension.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">QueryPath<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                        
                                                  		[ <a href="../classtrees_QueryPath.html" class="menu">class tree: QueryPath</a> ]
		[ <a href="../elementindex_QueryPath.html" class="menu">index: QueryPath</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">QueryPath</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file QueryPathExtension.php</h1>
<p>Documentation is available at <a href="../QueryPath/_src---QueryPath---QueryPathExtension.php.html">QueryPathExtension.php</a></p>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;file&nbsp;contains&nbsp;the&nbsp;Query&nbsp;Path&nbsp;extension&nbsp;tools.</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;Query&nbsp;Path&nbsp;can&nbsp;be&nbsp;extended&nbsp;to&nbsp;support&nbsp;additional&nbsp;features.&nbsp;To&nbsp;do&nbsp;this,</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;you&nbsp;need&nbsp;only&nbsp;create&nbsp;a&nbsp;new&nbsp;class&nbsp;that&nbsp;implements&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPathExtension}</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;and&nbsp;add&nbsp;your&nbsp;own&nbsp;methods.&nbsp;This&nbsp;class&nbsp;can&nbsp;then&nbsp;be&nbsp;registered&nbsp;as&nbsp;an&nbsp;extension.</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;It&nbsp;will&nbsp;then&nbsp;be&nbsp;available&nbsp;through&nbsp;Query&nbsp;Path.</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;For&nbsp;information&nbsp;on&nbsp;building&nbsp;your&nbsp;own&nbsp;extension,&nbsp;see&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPathExtension}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;If&nbsp;you&nbsp;are&nbsp;trying&nbsp;to&nbsp;load&nbsp;an&nbsp;extension&nbsp;you&nbsp;have&nbsp;downloaded,&nbsp;chances&nbsp;are&nbsp;good&nbsp;that</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;all&nbsp;you&nbsp;need&nbsp;to&nbsp;do&nbsp;is&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;require_once}</span><span class="src-doc">&nbsp;the&nbsp;file&nbsp;that&nbsp;contains&nbsp;the&nbsp;extension.</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;QueryPath</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;M&nbsp;Butcher&nbsp;&lt;matt@aleph-null.tv&gt;</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;http://opensource.org/licenses/lgpl-2.1.php&nbsp;LGPL&nbsp;or&nbsp;MIT-like&nbsp;license.</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPathExtension</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPathExtensionRegistry::extend()</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">&nbsp;*&nbsp;A&nbsp;QueryPathExtension&nbsp;is&nbsp;a&nbsp;tool&nbsp;that&nbsp;extends&nbsp;the&nbsp;capabilities&nbsp;of&nbsp;a&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;*&nbsp;Extensions&nbsp;to&nbsp;QueryPath&nbsp;should&nbsp;implement&nbsp;the&nbsp;QueryPathExtension&nbsp;interface.&nbsp;The</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">&nbsp;*&nbsp;only&nbsp;requirement&nbsp;is&nbsp;that&nbsp;the&nbsp;extension&nbsp;provide&nbsp;a&nbsp;constructor&nbsp;that&nbsp;takes&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc">&nbsp;*&nbsp;QueryPath&nbsp;object&nbsp;as&nbsp;a&nbsp;parameter.</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;*&nbsp;Here&nbsp;is&nbsp;an&nbsp;example&nbsp;QueryPath&nbsp;extension:</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;class&nbsp;StubExtensionOne&nbsp;implements&nbsp;QueryPathExtension&nbsp;{</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;private&nbsp;$qp&nbsp;=&nbsp;NULL;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;__construct(QueryPath&nbsp;$qp)&nbsp;{</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;qp&nbsp;=&nbsp;$qp;</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;stubToe()&nbsp;{</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;qp-&gt;find(':root')-&gt;append('&lt;toe/&gt;')-&gt;end();</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$this-&gt;qp;</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;*&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;*&nbsp;QueryPathExtensionRegistry::extend('StubExtensionOne');</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;*&nbsp;In&nbsp;this&nbsp;example,&nbsp;the&nbsp;StubExtensionOne&nbsp;class&nbsp;implements&nbsp;QueryPathExtension.</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;constructor&nbsp;stores&nbsp;a&nbsp;local&nbsp;copyof&nbsp;the&nbsp;QueryPath&nbsp;object.&nbsp;This&nbsp;is&nbsp;important</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-doc">&nbsp;*&nbsp;if&nbsp;you&nbsp;are&nbsp;planning&nbsp;on&nbsp;fully&nbsp;integrating&nbsp;with&nbsp;QueryPath's&nbsp;Fluent&nbsp;Interface.</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc">&nbsp;*&nbsp;Finally,&nbsp;the&nbsp;stubToe()&nbsp;function&nbsp;illustrates&nbsp;how&nbsp;the&nbsp;extension&nbsp;makes&nbsp;use&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc">&nbsp;*&nbsp;QueryPath&nbsp;internally,&nbsp;and&nbsp;remains&nbsp;part&nbsp;of&nbsp;the&nbsp;fluent&nbsp;interface&nbsp;by&nbsp;returning</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-doc">&nbsp;*&nbsp;the&nbsp;$qp&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-doc">&nbsp;*&nbsp;Notice&nbsp;that&nbsp;beneath&nbsp;the&nbsp;class,&nbsp;there&nbsp;is&nbsp;a&nbsp;single&nbsp;call&nbsp;to&nbsp;register&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;*&nbsp;extension&nbsp;with&nbsp;QueryPath's&nbsp;registry.&nbsp;Your&nbsp;extension&nbsp;should&nbsp;end&nbsp;with&nbsp;a&nbsp;line</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-doc">&nbsp;*&nbsp;similar&nbsp;to&nbsp;this.</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc">&nbsp;*&nbsp;&lt;b&gt;How&nbsp;is&nbsp;a&nbsp;QueryPath&nbsp;extension&nbsp;called?&lt;/b&gt;</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-doc">&nbsp;*&nbsp;QueryPath&nbsp;extensions&nbsp;are&nbsp;called&nbsp;like&nbsp;regular&nbsp;QueryPath&nbsp;functions.&nbsp;For</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-doc">&nbsp;*&nbsp;example,&nbsp;the&nbsp;extension&nbsp;above&nbsp;can&nbsp;be&nbsp;called&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;*&nbsp;qp('some.xml')-&gt;stubToe();</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;*&nbsp;Since&nbsp;it&nbsp;returns&nbsp;the&nbsp;QueryPath&nbsp;($qp)&nbsp;object,&nbsp;chaining&nbsp;is&nbsp;supported:</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;*&nbsp;print&nbsp;qp('some.xml')-&gt;stubToe()-&gt;xml();</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-doc">&nbsp;*&nbsp;When&nbsp;you&nbsp;write&nbsp;your&nbsp;own&nbsp;extensions,&nbsp;anything&nbsp;that&nbsp;does&nbsp;not&nbsp;need&nbsp;to&nbsp;return&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a67"></a><span class="src-doc">&nbsp;*&nbsp;specific&nbsp;value&nbsp;should&nbsp;return&nbsp;the&nbsp;QueryPath&nbsp;object.&nbsp;Between&nbsp;that&nbsp;and&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-doc">&nbsp;*&nbsp;extension&nbsp;registry,&nbsp;this&nbsp;will&nbsp;provide&nbsp;the&nbsp;best&nbsp;developer&nbsp;experience.</span></div></li>
<li><div class="src-line"><a name="a69"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-key">interface&nbsp;</span><a href="../QueryPath/QueryPathExtension.html">QueryPathExtension</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtension.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-id">QueryPath&nbsp;</span><span class="src-var">$qp</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a72"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-doc">&nbsp;*&nbsp;A&nbsp;registry&nbsp;for&nbsp;QueryPath&nbsp;extensions.</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a77"></a><span class="src-doc">&nbsp;*&nbsp;QueryPath&nbsp;extensions&nbsp;should&nbsp;call&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPathExtensionRegistry::extend()}</span></div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-doc">&nbsp;*&nbsp;function&nbsp;to&nbsp;register&nbsp;their&nbsp;extension&nbsp;classes.&nbsp;The&nbsp;QueryPath&nbsp;library&nbsp;then</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;*&nbsp;uses&nbsp;this&nbsp;information&nbsp;to&nbsp;determine&nbsp;what&nbsp;QueryPath&nbsp;extensions&nbsp;should&nbsp;be&nbsp;loaded&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-doc">&nbsp;*&nbsp;executed.</span></div></li>
<li><div class="src-line"><a name="a81"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a82"></a><span class="src-key">class&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html">QueryPathExtensionRegistry</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Internal&nbsp;flag&nbsp;indicating&nbsp;whether&nbsp;or&nbsp;not&nbsp;the&nbsp;registry&nbsp;should</span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;be&nbsp;used&nbsp;for&nbsp;automatic&nbsp;extension&nbsp;loading.&nbsp;If&nbsp;this&nbsp;is&nbsp;false,&nbsp;then</span></div></li>
<li><div class="src-line"><a name="a86"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;implementations&nbsp;should&nbsp;not&nbsp;automatically&nbsp;load&nbsp;extensions.</span></div></li>
<li><div class="src-line"><a name="a87"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$useRegistry&nbsp;</span>=&nbsp;<span class="src-id">TRUE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;extension&nbsp;registry.&nbsp;This&nbsp;should&nbsp;consist&nbsp;of&nbsp;an&nbsp;array&nbsp;of&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a91"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;names.</span></div></li>
<li><div class="src-line"><a name="a92"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$extensionRegistry&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$extensionMethodRegistry&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a96"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Extend&nbsp;QueryPath&nbsp;with&nbsp;the&nbsp;given&nbsp;extension&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodextend">extend</a><span class="src-sym">(</span><span class="src-var">$classname</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$extensionRegistry</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$classname</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$class&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">ReflectionClass</span><span class="src-sym">(</span><span class="src-var">$classname</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$methods&nbsp;</span>=&nbsp;<span class="src-var">$class</span><span class="src-sym">-&gt;</span><span class="src-id">getMethods</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$methods&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$method</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$extensionMethodRegistry</span><span class="src-sym">[</span><span class="src-var">$method</span><span class="src-sym">-&gt;</span><span class="src-id">getName</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$classname</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a108"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Check&nbsp;to&nbsp;see&nbsp;if&nbsp;a&nbsp;method&nbsp;is&nbsp;known.</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;checks&nbsp;to&nbsp;see&nbsp;if&nbsp;the&nbsp;given&nbsp;method&nbsp;name&nbsp;belongs&nbsp;to&nbsp;one&nbsp;of&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a110"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;registered&nbsp;extensions.&nbsp;If&nbsp;it&nbsp;does,&nbsp;then&nbsp;this&nbsp;will&nbsp;return&nbsp;TRUE.</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$name&nbsp;</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;method&nbsp;to&nbsp;search&nbsp;for.</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
<li><div class="src-line"><a name="a115"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;TRUE&nbsp;if&nbsp;the&nbsp;method&nbsp;exists,&nbsp;false&nbsp;otherwise.</span></div></li>
<li><div class="src-line"><a name="a116"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodhasMethod">hasMethod</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span>isset<span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$extensionMethodRegistry</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a120"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Check&nbsp;to&nbsp;see&nbsp;if&nbsp;the&nbsp;given&nbsp;extension&nbsp;class&nbsp;is&nbsp;registered.</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Given&nbsp;a&nbsp;class&nbsp;name&nbsp;for&nbsp;a&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPathExtension}</span><span class="src-doc">&nbsp;class,&nbsp;this</span></div></li>
<li><div class="src-line"><a name="a124"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;check&nbsp;to&nbsp;see&nbsp;if&nbsp;that&nbsp;class&nbsp;is&nbsp;registered.&nbsp;If&nbsp;so,&nbsp;it&nbsp;will&nbsp;return</span></div></li>
<li><div class="src-line"><a name="a125"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;TRUE.</span></div></li>
<li><div class="src-line"><a name="a126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a127"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$name&nbsp;</span></div></li>
<li><div class="src-line"><a name="a128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a129"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
<li><div class="src-line"><a name="a130"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;TRUE&nbsp;if&nbsp;the&nbsp;class&nbsp;is&nbsp;registered,&nbsp;FALSE&nbsp;otherwise.</span></div></li>
<li><div class="src-line"><a name="a131"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodhasExtension">hasExtension</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span>isset<span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$extensionRegistry</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;the&nbsp;class&nbsp;that&nbsp;a&nbsp;given&nbsp;method&nbsp;belongs&nbsp;to.</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Given&nbsp;a&nbsp;method&nbsp;name,&nbsp;this&nbsp;will&nbsp;check&nbsp;all&nbsp;registered&nbsp;extension&nbsp;classes</span></div></li>
<li><div class="src-line"><a name="a139"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;see&nbsp;if&nbsp;any&nbsp;of&nbsp;them&nbsp;has&nbsp;the&nbsp;named&nbsp;method.&nbsp;If&nbsp;so,&nbsp;this&nbsp;will&nbsp;return</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;classname.</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Note&nbsp;that&nbsp;if&nbsp;two&nbsp;extensions&nbsp;are&nbsp;registered&nbsp;that&nbsp;contain&nbsp;the&nbsp;same</span></div></li>
<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;method&nbsp;name,&nbsp;the&nbsp;last&nbsp;one&nbsp;registred&nbsp;will&nbsp;be&nbsp;the&nbsp;only&nbsp;one&nbsp;recognized.</span></div></li>
<li><div class="src-line"><a name="a144"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a145"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$name&nbsp;</span></div></li>
<li><div class="src-line"><a name="a146"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;method.</span></div></li>
<li><div class="src-line"><a name="a147"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
<li><div class="src-line"><a name="a148"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a149"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodgetMethodClass">getMethodClass</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$extensionMethodRegistry</span><span class="src-sym">[</span><span class="src-var">$name</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a154"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a155"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;extensions&nbsp;for&nbsp;the&nbsp;given&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a156"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a157"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Given&nbsp;a&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPath}</span><span class="src-doc">&nbsp;object,&nbsp;this&nbsp;will&nbsp;return</span></div></li>
<li><div class="src-line"><a name="a158"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;an&nbsp;associative&nbsp;array&nbsp;of&nbsp;extension&nbsp;names&nbsp;to&nbsp;(new)&nbsp;instances.</span></div></li>
<li><div class="src-line"><a name="a159"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Generally,&nbsp;this&nbsp;is&nbsp;intended&nbsp;to&nbsp;be&nbsp;used&nbsp;internally.</span></div></li>
<li><div class="src-line"><a name="a160"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">QueryPath&nbsp;</span><span class="src-doc-var">$qp&nbsp;</span></div></li>
<li><div class="src-line"><a name="a162"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;QueryPath&nbsp;into&nbsp;which&nbsp;the&nbsp;extensions&nbsp;should&nbsp;be&nbsp;registered.</span></div></li>
<li><div class="src-line"><a name="a163"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
<li><div class="src-line"><a name="a164"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;An&nbsp;associative&nbsp;array&nbsp;of&nbsp;classnames&nbsp;to&nbsp;instances.</span></div></li>
<li><div class="src-line"><a name="a165"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodgetExtensions">getExtensions</a><span class="src-sym">(</span><span class="src-id">QueryPath&nbsp;</span><span class="src-var">$qp</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extInstances&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$extensionRegistry&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$ext</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$extInstances</span><span class="src-sym">[</span><span class="src-var">$ext</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-var">$ext</span><span class="src-sym">(</span><span class="src-var">$qp</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$extInstances</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Enable&nbsp;or&nbsp;disable&nbsp;automatic&nbsp;extension&nbsp;loading.</span></div></li>
<li><div class="src-line"><a name="a176"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a177"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;extension&nbsp;autoloading&nbsp;is&nbsp;disabled,&nbsp;then&nbsp;QueryPath&nbsp;will&nbsp;not</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;automatically&nbsp;load&nbsp;all&nbsp;registred&nbsp;extensions&nbsp;when&nbsp;a&nbsp;new&nbsp;QueryPath</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;object&nbsp;is&nbsp;created&nbsp;using&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;qp()}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a180"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodautoloadExtensions">autoloadExtensions</a><span class="src-sym">(</span><span class="src-var">$boolean&nbsp;</span>=&nbsp;<span class="src-id">TRUE</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$useRegistry&nbsp;</span>=&nbsp;<span class="src-var">$boolean</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a184"></a><span class="src-sym">}</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:19 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>